package serveur;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import remote.Tweet;

/**
 * Classe représentant un utilisateur
 *
 */
public class User implements Serializable {
	private String pseudo;
	private String pswd;
	// Who follow me
	private List<String> followers;
	// Who i follow
	private List<String> follow;
	// Tweets that User I follow pushed
	private List<Tweet> pending;
	
	public User(String pseudo, String pswd) {
		this.pseudo = pseudo;
		this.pswd = pswd;
		follow = new ArrayList<String>();
		followers = new ArrayList<String>();
		pending = new ArrayList<Tweet>();
	}

	public String getPseudo() {
		return pseudo;
	}

	public void setPseudo(String pseudo) {
		this.pseudo = pseudo;
	}

	public String getPswd() {
		return pswd;
	}

	public void setPswd(String pswd) {
		this.pswd = pswd;
	}

	public List<String> getFollowers() {
		return followers;
	}
	
	public void addFollowers(String pseudo) {
		followers.add(pseudo);
	}
	
	public void removeFollowers(String pseudo) {
		followers.remove(pseudo);
	}

	public List<String> getFollow() {
		return follow;
	}
	
	public void addFollow(String pseudo) {
		follow.add(pseudo);
	}
	
	public void removeFollow(String pseudo) {
		follow.remove(pseudo);
	}

	/**
	 * Get pending tweets and delete them
	 * @return List of non read tweets
	 */
	public List<Tweet> getPending() {
		return pending;
	}

	@Override
	public String toString() {
		return "User [pseudo=" + pseudo + ", pswd=" + pswd + "]";
	}	
	
	
}
